import enum


class BaseEnum(enum.Enum):
    @classmethod
    def choices(cls):
        return [(choice, choice.value) for choice in cls]

    @classmethod
    def coerce(cls, item):
        return cls(int(item)) if not isinstance(item, cls) else item

    def __str__(self):
        return str(self.value)


class OrderType(BaseEnum):
    single_document = "single_document"
    mass_generation = "mass_generation"


class OrderStatus(BaseEnum):
    waiting_payment = "Ждет оплаты"
    payed = "Оплачен"
